<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *项目管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return['sex']=$this->sex2;
$return['pay']=$this->xinzhis;
$return['job_type']=$this->job_type;
$return['job_paytype']=$this->job_paytype;
$return['job_baotype']=$this->job_baotype;
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'agentid'=>0);
	if(isset($_RQ['status'])){
		$params['status']=intval($_RQ['status']);
		$return['params']['status']=$_RQ['status'];
	}
	if($_RQ['name']){
		$params2=array('uniacid'=>$_SESSION['uniacid']);
		$params2['name like']='%'.trim($_RQ['name']).'%';
		$jianliid=pdo_getall('jy_51job_jianli',$params2,'id','id');
		$jianliid=$jianliid?array_keys($jianliid):-1;
		$params['jianliid']=$jianliid;
		$return['params']['name']=$_RQ['name'];
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_51job_agentfee',$params,array($pindex,$psize),$total,$fields,'','createtime desc,id desc');
	if($list){
		foreach($list as &$item){
			$item['merchname']=pdo_getcolumn('jy_51job_merch',array('id'=>$item['merchid'],'uniacid'=>$_SESSION['uniacid']),'title');
			$jianli=pdo_get('jy_51job_jianli',array('id'=>$item['jianliid'],'uniacid'=>$_SESSION['uniacid']));
			$item=array_merge($jianli,$item);
		}
	}
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'推荐列表'),
		),
		'list'=>array('data'=>'list','tip'=>'<red>[温馨提示]：这里显示后台的推荐</red>','edit'=>false,'list'=>array(
			array('name'=>'jianliid','title'=>'简历ID','type'=>'string'),
			array('name'=>'merchname','title'=>'目标企业','type'=>'string'),
			array('name'=>'fee','title'=>'支付费用','type'=>'string'),
			array('name'=>'city','title'=>'城市','type'=>'string'),
			array('name'=>'name','title'=>'姓名','type'=>'string'),
			array('name'=>'sex','title'=>'性别','type'=>'radio','options'=>'sex'),
			array('name'=>'mobile','title'=>'电话','type'=>'string'),
			array('type'=>'radio','title'=>'学历','name'=>'xueli','help'=>'','options'=>'xueli'),
			array('name'=>'title','title'=>'职位意向','type'=>'string'),
			array('name'=>'age','title'=>'出生年份','type'=>'string'),
			array('name'=>'express','title'=>'工作经验','type'=>'string'),
			array('name'=>'address','title'=>'现居住地','type'=>'string'),
		)),
		'search'=>array(
			array('name'=>'name','width'=>10,'title'=>'姓名','type'=>'string'),
		)
	);
	$return['sex']=$this->sex;
	$return['xueli']=$this->xueli_type;
	$return['tuijie_status']=$this->tuijie_status;
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='del'){
	$del=trim($_RQ['del'],';');
	if($del){
		$del=explode(';',$del);
	}else{
		$del=array();
	}
	if($_RQ['id']){
		$del[]=$_RQ['id'];
	}
	foreach($del as $id){
		$id=intval($id);
		if($id){
			pdo_delete('jy_51job_agentfee',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
		}
	}
	exi('删除成功！');
}